package com.heima.service.impl;

import com.heima.mapper.AssignmentMapper;
import com.heima.pojo.Assignment;
import com.heima.pojo.utils.Result;
import com.heima.service.AssignmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName AssignmentServiceImpl
 * @Author Administrator
 * @create 2022/11/13 19:48
 */
@Service
public class AssignmentServiceImpl implements AssignmentService {
    @Autowired
    AssignmentMapper assignmentMapper;

    @Override
    public Result publishWork(Assignment assignment) {
        int insert = assignmentMapper.insert(assignment);
        if (insert > 0)
            return new Result(0 , "操作成功" , "作业发布成功");
        return new Result(-1 , "操作失败" , "作业发布失败");
    }
}
